package com.huangbc.serviceorder.generator;

/**
 * @Author: Derek.huang on 2024/3/30 16:07.
 */

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * 自动生成代码工具类
 */
public class MysqlGenerator {
    public static void main(String[] args) {

        FastAutoGenerator.create("jdbc:mysql://192.168.11.26:3306/service-order?characterEncoding=utf-8&serverTimezone=GMT%2B8",
                        "root","root123")
                .globalConfig(builder -> {
                    builder.author("Derek.huangbc").fileOverride().outputDir("F:\\2024_work_spase\\online-taxi-public\\service-order\\src\\main\\java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.huangbc.serviceorder").pathInfo(Collections.singletonMap(OutputFile.mapperXml,
                            "F:\\2024_work_spase\\online-taxi-public\\service-order\\src\\main\\java\\com\\huangbc\\serviceorder\\mapper"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("driver_order_statistics");

                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
